package coml.jiyun.hp.wanandroid.model;

import coml.jiyun.hp.wanandroid.base.BaseModel;
import coml.jiyun.hp.wanandroid.bean.AnswerBean;
import coml.jiyun.hp.wanandroid.bean.BannerBean;
import coml.jiyun.hp.wanandroid.net.HttpUtil;
import coml.jiyun.hp.wanandroid.net.ResultCallBack;
import coml.jiyun.hp.wanandroid.net.ResultSubscriber;
import coml.jiyun.hp.wanandroid.net.RxUtils;

public class AnswerModel extends BaseModel {

    public void getAnswer(final ResultCallBack<AnswerBean> callBack) {
        addDisposable(HttpUtil.getInstance()
                .getAnswerServer()
                .getAnswer()
                .compose(RxUtils.<AnswerBean>rxSchedulerHelper())
                .subscribeWith(new ResultSubscriber<AnswerBean>() {
                    @Override
                    public void onNext(AnswerBean answerBean) {
                        callBack.onSuccess(answerBean);
                    }
                }));
    }

}
